﻿using System;

using Microsoft.Practices.EnterpriseLibrary.Validation;

namespace Framework.Validation.Vab
{
    /// <summary>
    /// Contains business result of <see cref="IValidator" /> work.
    /// </summary>
    public class VabValidationResultWrapper : ValidationResult
    {
        private readonly IValidationResult validationResult;

        /// <summary>
        /// Initializes a new instance of the <see cref="VabValidationResultWrapper"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="target">The target.</param>
        /// <param name="key">The key.</param>
        /// <param name="tag">The tag.</param>
        /// <param name="validator">The validator.</param>
        /// <param name="validationResult">The validation result.</param>
        public VabValidationResultWrapper(
            string message,
            object target,
            string key,
            string tag,
            Validator validator,
            IValidationResult validationResult)
            : base(message, target, key, tag, validator)
        {
            if (validationResult == null)
            {
                throw new ArgumentNullException("validationResult");
            }

            this.validationResult = validationResult;
        }

        /// <summary>
        /// Gets the <see cref="IValidationResult" /> instance.
        /// </summary>
        public IValidationResult ValidationResult
        {
            get
            {
                return validationResult;
            }
        }
    }
}
